package com.example.pet.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.pet.dao.PhotoDao;
import com.example.pet.entity.Collect;
import com.example.pet.entity.Photo;
import com.example.pet.service.PhotoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * ����ͷ���(Photo)表服务实现类
 *
 * @author makejava
 * @since 2023-05-13 17:30:13
 */
@Service
public class PhotoServiceImpl implements PhotoService {
    @Resource
    private PhotoDao photoDao;
    @Override
    public boolean add(Photo photo) {
        return photoDao.insert(photo)>0;
    }
    @Override
    public Photo getAll(Integer id) {
        QueryWrapper<Photo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id",id);
        return photoDao.selectOne(queryWrapper);
    }
}

